package service;

public class TransPriceService {
	
	/**
	 * 计算运价，一公斤起，不足一公斤按照一公斤计
	 * 超过一公斤需要收取续价
	 * 
	 * @param basePrice
	 * @param renewalPrice
	 * @param weight
	 * @return
	 */
	public static Double countTransferFee(Double basePrice, Double renewalPrice,Double weight){
		
		Double result = 0.0;
		
		if(weight!=null){
			if(weight<=0){
				result = 0.0;
			}else if(weight>0 && weight<1.0){
				result = basePrice;
			}else{
				result = basePrice + renewalPrice*weight;
			}
		}
		
		return result;
	}
}
